<table class="table table-striped table-bordered" formmode="view" usecolor="false" usehover="false" useclick="false" useradio="false" usecheckbox="false">
    <input  name="customer_id" id="customer_id" type="hidden" value="" truetype="hidden">
    <tbody><tr>
        <th colspan="2" style="font-size: 14px; font-weight: bold; text-align: center;" class="th">增加商户</th>

    </tr>
    <tr>
        <td class="col-md-3"><font color="red">*</font>商户名称：</td>
        <td style="padding-top: 6px; padding-bottom: 6px;">
            <input class="form-control" type="text" id="customer_name" name="customer_name" onkeyup="chek_qj(this);"  value="" truetype="textinput">
        </td>
    </tr>

    <tr>
        <td   class="col-md-3"><font color="red">*</font>QQ号码：</td>
        <td style="padding-top: 6px; padding-bottom: 6px;">
            <input class="form-control" type="text" id="QQ" name="QQ" inputmode="numberOnly" onkeyup="chek_qj(this);"  value="" truetype="textinput">
        </td>
    </tr>

    <tr>
        <td   class="col-md-3"><font color="red">*</font>微信号码：</td>
        <td style="padding-top: 6px; padding-bottom: 6px;">
            <input class="form-control" type="text" id="wxh" name="wxh" onkeyup="chek_qj(this);"  value="" truetype="textinput">
        </td>
    </tr>

    <tr>
        <td   class="col-md-3"><font color="red">*</font>联系电话：</td>
        <td style="padding-top: 6px; padding-bottom: 6px;">
            <input class="form-control" type="text" id="phone" name="phone" onkeyup="chek_qj(this);"  value="" truetype="textinput">
        </td>
    </tr>

    <tr>
        <td  class="col-md-3" ><font color="red">*</font>登录账号：</td>
        <td style="padding-top: 6px; padding-bottom: 6px;">
            <input class="form-control" type="text" id="login_name" name="login_name" onkeyup="chek_qj(this);"  value="" truetype="textinput">
        </td>
    </tr>

    <tr>
        <td  class="col-md-3" >登录密码：</td>
        <td style="padding-top: 6px; padding-bottom: 6px;">
            <input class="form-control" type="text" id="login_pwd" name="login_pwd" onkeyup="chek_qj(this);"  value="" truetype="textinput">

            (<font color="red">温馨提示：</font>如果不设置密码将使用默认密码：888888)

        </td>
    </tr>
    <tr>
        <td  class="col-md-3" ><font color="red">*</font>商户等级：</td>
        <td style="padding-top: 6px; padding-bottom: 6px;">


            <select id="level" class="form-control">
                <option value="0">非认证商户</option>
                <option value="1">认证商户V1</option>
                <option value="2">认证商户V2</option>
                <option value="3">认证商户V3</option>
            </select>
        </td>
    </tr>
    <tr>
        <td  class="col-md-3" ><font color="red">*</font>是否有效：</td>
        <td style="padding-top: 6px; padding-bottom: 6px;">
            <input type="radio" id="enabled_ok" checked="" name="enabled" value="1" truetype="radio">有效
            <input type="radio" id="enabled_no" name="enabled" value="0" truetype="radio">无效
            (<font color="red">温馨提示：</font>如果选择【无效】商户将无法登录且商户的商品不会出现在推广商品列表)
        </td>
    </tr>

    <!--<tr height="45">
        <td height="45" align="right" colspan="2" style="text-align: center; background-color: rgb(255, 255, 255); padding-top: 6px; padding-bottom: 6px;">
            <input type="button" onclick="save();" style="cursor: pointer; width: 60px;" value="保存" class="button">
            &nbsp;&nbsp;&nbsp;
            <input type="button" onclick="goToPage('user!getCustomerList.ct');" style="cursor: pointer; width: 60px;" value="返回" class="button">
        </td>
    </tr>-->

</tbody>
</table>


<script>
    function save() {
        var merchantName = $("#customer_name").val();

        var QQ = $("#QQ").val();
        var wxh = $("#wxh").val();
        var phone = $("#phone").val();
        var login_name = $("#login_name").val();
        var login_pwd = $("#login_pwd").val();
        var state = $("#state").val();
        var level = $("#level").val();
        var state=0;

        var radioArray = $("input[name='enabled']");

        for (let i = 0; i < radioArray.length; i++) {
            var radioTag = radioArray[i];
            var bool = radioTag.checked;

            if (bool) {
                state=$(radioTag).val();
            }
        }
        $.post("merchant/save",{customerName:merchantName,qq:QQ,wxh:wxh,phone:phone,loginName:login_name,loginPwd:login_pwd,state:state,level:level},function (data) {
            if (data.code==0){
                $("#myModal").modal("hide");
                $("#right").load("merchant/list");
                //alert("sss");
            }
        })
    }
</script>